﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectReception.aspx.cs" Inherits="RGPWEB.EN.OrderS.SelectReception" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link href="../../inc/Style/index.css" rel="Stylesheet" type="text/css" />
<link href="../../inc/Style/contentstyle.css" rel="Stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../../inc/script/pub.js"></script>
<link href="../../inc/Style/GridView.css" rel="Stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
        function returnvalue(men,tel,eid,company,poscode,add,city,state,country) //参数分别为id,name和password
        {
            window.returnValue = men + "'" + tel + "'" + eid + "'" + company + "'" + poscode + "'" + add + "'" + city + "'" + state + "'" + country;  //返回值
            //alert(window.returnValue);
            window.close();
        }
        function returnwin(listnum) {
            //alert(listnum);
            if (IsEmpty(listnum.split("|")[0])) {
                window.opener.document.getElementById("txt_recmen").value = listnum.split("|")[0];
            } //返回值分别赋值给相关文本框
            if (IsEmpty(listnum.split("|")[1])) {
                window.opener.document.getElementById("txt_reccompany").value = listnum.split("|")[1];
            }
            if (IsEmpty(listnum.split("|")[2])) {
                window.opener.document.getElementById("txt_rectel").value = listnum.split("|")[2];
            } //返回值分别赋值给相关文本框
            if (IsEmpty(listnum.split("|")[3])) {
                window.opener.document.getElementById("txt_receid").value = listnum.split("|")[3];
            }
            if (IsEmpty(listnum.split("|")[5])) {
                window.opener.document.getElementById("txt_reccity").value = listnum.split("|")[5];
            }
            if (IsEmpty(listnum.split("|")[6])) {
                window.opener.document.getElementById("txt_recpostcode").value = listnum.split("|")[6];
            }  //返回值分别赋值给相关文本框
            if (IsEmpty(listnum.split("|")[7])) {
                window.opener.document.getElementById("txt_receadd").value = listnum.split("|")[7];
            }
            var ddlcountry = window.opener.document.getElementById("ddl_reccountry");
            var scountry = ddlcountry.getElementsByTagName("option");
            for (var i = 0; i < scountry.length; i++) {
                if (scountry[i].value == listnum.split("|")[4]) {
                    window.opener.ddlcountry.selectedIndex = i;
                    alert(i);
                }
            }
            window.close();       
        }
    </script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
           <fieldset id="10" style="width:98%">
            <legend>Search Conditions</legend>
            <table style="width:100%;">
                <tr>
                    <td>
                        Recipients：</td>
                    <td>
                        <asp:TextBox ID="txt_sendmen_search" runat="server"></asp:TextBox>
                    </td>
                    <td>
                            <asp:Panel ID="pal_manager" runat="server">
                                CustomerS：<asp:ComboBox ID="cmb_list" runat="server" AutoCompleteMode="SuggestAppend" 
                                    DropDownStyle="DropDownList">
                                </asp:ComboBox>
&nbsp;<asp:ToolkitScriptManager ID="ScriptManager1" runat="server" />
                            </asp:Panel>
                           
                    </td>
                    <td>
                        <asp:Button ID="btn_search" runat="server" Text="Search" 
                            onclick="btn_search_Click" />
                                                    </td>
                </tr>
                </table>
            </fieldset>
            <fieldset>
                <legend>Result</legend>
                <asp:GridView ID="grv_list" runat="server" 
                    AutoGenerateColumns="False" DataKeyNames ="R_ID" onrowdatabound="grv_list_RowDataBound" 
                    CssClass="Grid" AllowSorting="True" 
                    onselectedindexchanging="grv_list_SelectedIndexChanging">
                    <FooterStyle CssClass="GridFooter" />
                    <RowStyle CssClass="Row" />
                    <HeaderStyle CssClass="HeadingCell" />
                    <Columns>
                        <asp:BoundField HeaderText="Recipients" DataField="R_Men" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Company Name" DataField="R_Company" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Tel" DataField="R_Tel" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="EID" DataField="R_EID" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Country" DataField="R_CountryName" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                         <asp:BoundField HeaderText="City" DataField="R_CityName" ItemStyle-Width="10%">
                            <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>                        
                        <asp:BoundField HeaderText="Post Code" DataField="R_PostCode" ItemStyle-Width="10%">
                               <ItemStyle Width="10%"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Address" DataField="R_Add" ItemStyle-Width="20%">
                            <ItemStyle Width="20%"></ItemStyle>
                        </asp:BoundField>                        
                    </Columns>
                </asp:GridView>
                <webdiyer:AspNetPager ID="anp_list" runat="server" 
                    onpagechanging="anp_list_PageChanging"  PrevPageText="UP" 
                    FirstPageText="First" LastPageText="Last" NextPageText="Next" 
                    ScrollBars="Vertical" UrlPaging="false" ShowPageIndexBox="Always" 
                    PageIndexBoxType="DropDownList" TextBeforePageIndexBox="PageSize:" 
                    HorizontalAlign="center" CustomInfoTextAlign="Left">
                </webdiyer:AspNetPager>
            </fieldset>
        </div>
    </form>
</body>
</html>
